$(document).ready(
		function() {
			console.log('hey');
			var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket
			var socket = new WS("ws://localhost:9000/helloSocket?name=mph");
			// var socket = new WebSocket(host);

			message('<p class="event">Socket Status: ' + socket.readyState);

			socket.onopen = function() {
				message('<p class="event">Socket Status: ' + socket.readyState
						+ ' (open)');
			}

			socket.onmessage = function(msg) {
				message('<p class="message">Received: ' + msg.data);
			}

			socket.onclose = function() {
				message('<p class="event">Socket Status: ' + socket.readyState
						+ ' (Closed)');
			}
		});

function requestJson() {
	$.get('/pointApi', function(data) {
		console.log('got ' + data);
		var text = JSON.stringify(data, null, '\t');
		$('#debug').append(text);
		//$('#debug').append(prettyPrint(data));
	});

}

function message(msg) {
	$('#chatLog').html(msg + '</p>');
}
